package com.candy.shopproduct.service.impl;
import com.candy.entity.Product;
import com.candy.shopproduct.dao.ProductMapper;
import com.candy.shopproduct.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper productMapper;
    @Override
    public Product getProductById(int id) {
        return productMapper.selectByPrimaryKey(id);
    }
    @Override
    public boolean editProduct(Integer pid) {
        int num=productMapper.updateStock(pid);
        if(num>0){
            return true;
        }else {
            return false;
        }
    }
}
